package com.symaster.backups.util;

import javax.swing.*;
import java.awt.event.MouseEvent;

public class MyMouseListener extends MouseListenerImpl {
    private final JPopupMenu jpopupmenu;

    public MyMouseListener(JPopupMenu jpopupmenu) {
        this.jpopupmenu = jpopupmenu;
    }

    public void display(MouseEvent e) {
        if (e.isPopupTrigger()) {
            jpopupmenu.show(e.getComponent(), e.getX(), e.getY());
        }
    }

    public void mouseReleased(MouseEvent e) {
        this.display(e);
    }
}